package com.lord.label.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lord.label.dao.ResultDao;
import com.lord.label.domain.Result;
import com.lord.label.service.ResultService;

/**
 * 
 * @Description: 结果业务实现逻辑类
 * @author Lord
 * @date 2017年5月23日 下午3:09:32
 */
@Service
public class ResultServiceImpl implements ResultService {

	@Autowired
	private ResultDao resultDao;
	
	@Override
	public int insert(Result result) {
		return resultDao.insertSelective(result);
	}

	@Override
	public int delete(Long id) {
		return resultDao.deleteByPrimaryKey(id);
	}

	@Override
	public int update(Result result) {
		return resultDao.updateByPrimaryKeySelective(result);
	}

	@Override
	public Result findById(Long id) {
		return resultDao.selectByPrimaryKey(id);
	}

	@Override
	public List<Result> findAll() {
		return resultDao.findAll();
	}

	@Override
	public List<Result> findByKey(String key) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put(key, key);
		return resultDao.findByKey(map);
	}

}
